package com.alipay.config;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 */

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117677011";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCTfB/M9tLrpwqhM5Kcf8s82OeeM4yvypMGl/rALgsBgAGRyS+Yg3xIAxpE38UZhvjvqK/Al3dH/3CMHszOZBmc8MolRk32TiCYRisSdlZiV4aKlCCUJx/w1wKVPiLLnvdSlgNP5UKh/pt1MRi6Y7AglKdlkew4JGHQgUSE48oO+h2YAro6ZCfhgq+GT9fLc9KYIoNK3DQ+iy+Lvt8tCJh/fIxehUcDSmd1/dY7ZrgZq9XMPay1uhZCb0pxNBMOTiu7VX94oGWEcbTd/F2hVMI1emd5SNtFBR51dYxPdtD/pOzJWC84CKR0fD7ohfybdI4EI2BhSKG69FV35/AwRlJzAgMBAAECggEAPThU6vu56d/Y5blGrnfNoWBYJK85Qu9PwHjtuUBjiSfdfuqIO0K5IBtJmDVa15HTW4gmDEfTV6uMyF0wnqumhiLdhkN8sTUVCqB12KAOk5vJWVTLgTQMaiiWBeVZBDTkbP+gOFXuJthNJ4RNw3EF90A9jEfaSiOwBqDiFFeJ1FUT3RHePGZT079TS1oa9GB8zWBdV1yVzJy7jxvQD81XYFfoW0jjtBWjnrkK27wiSwDVWRhfjHID/joT/BuhADrvHlCE9h/JzBEESufwzE2N6JFqlPq2Y8LpvbTntKa8zGPhBSKJgncTNZCVK20l5K28Nnsz3K0bCIx09lbqFBEYIQKBgQDbRAc7FrlVWV39TQsr0uW0xYknP0OTmQ+s4YqadSrj0Je7S1Sz17dQ8udiYMYQcMwkYx4/AvPLf8VTmOd88fLEpYMWQ5XnhC7wfwvYDm4yL0+yhztiqjl6oiCnx3IJsw4UQvFTN/YOh1Q0v0dB1HF3qZlIjPgNBz1/UWg+6k3rTwKBgQCsMYYsrtw+WvGgKxBw9ppgZJl8Cw0UWF5pck/6+2tby7JB7o2FdaP0QT8XLFtWeZqxWtcmlfbOzfl63u1+Upld45LqoarYh75qhXHSvJXWnp8QlIBSQydbstJzl5RKwGfkv7vnglgrSCzx6326pbPrNuX925utri+J5mV9c1YNnQKBgColQFKOQp9yJwvKJEyPJBIEKiG+GkojkIzFaXPY856IeLHKgAR1gUnw9qLFQSzl0Ydo+eZYte22qIIyEMTGaMh9m93KreSrVq5pbShhVbMVvvbs4XBMkfHNegNl5biRjzI7z9EUH5qZTok4/wRbRlge5FS6q+8tJhfz2NrHBKUnAoGARYDT7LND+PNSdlkLkN0pIOFaRoRbaivlJ+DZQbA7/FhzAkPc4dLDM/MmGR9xWq1I8G9/SnbboUvoeF0FNaj3eLtD8OsCf9YC2RI2CF7QiEmMYO/f/9RVTaEXa0rys12IUf/GQ8ML/aRrZ9aq8Cy0O6v0F4yOAQO+8oWJz6I/SM0CgYBHkIgcYsl8mX1fWPGuokS9flM1ZY1q6kMSjQegua2+lLtSHw49bBxqzr1U3GQidbBlDQFagJE8A71yKkLyWipH1ayLOP6PnawYe9UdO4H2lSrmQPZeQRt1H80dImAkJPfWbygy6O+hkw1DmafH2EF7L7pqUbVOnOKfrW0jC6jyyA==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmQSipN+JbbK/EbmxoTKjUymkmvONqveDtxvrqn5GDDE7ct1G9+pkznquSGLMbBPmPJid2PWPWujJW8OFNXnLnGuLXYdsMPsUwnVSKiNV34E8eDLcgQJ4SCBxnDGOsEsG+0vwcSmLxPzWftB6JX5dWOaTitiio7jR0wA/Swm2YAPACogSd6qfdBWkix18VukAst4tWDSCurZ0fkKB+IcNQj7FWZ4RBPQM+cY2z+zhmGOC+eAODHtWMIQhywVd3wplNeW/XrtcdkorLCFc88K/5rzdqX/KsK0CFn0oVb5nzVUckobXqb+zU8uHT2E5quiVGOeS1q6I79X9LoyyRgn/swIDAQAB";

    //服务器异步通知页面路径，部署在公网下的网页；如果只是自己测试，可以不用在公网下，甚至可以不填，如果不填的话记得把下面代码中设置这一项的那一行注释。
    // 服务器异步通知页面路径 需http://或者https://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    //public static String notify_url = "http://192.168.31.105/alipay.trade.wap.pay-JAVA-UTF-8/notify_url.jsp";
    public static String notify_url = "http://hkxh4hlx.dongtaiyuming.net/flower/notify_url";

    //页面跳转同步通知页面路径，部署在公网下的网页；如果只是自己测试，可以不用在公网下，甚至可以不填，如果不填的话记得把下面代码中设置这一项的那一行注释。
    //页面跳转同步通知页面路径 需http://或者https://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问 商户可以自定义同步跳转地址
    //public static String return_url = "${pageContext.request.contextPath}/product/getshoppingList";
    //public static String return_url = "http://192.168.31.105/alipay.trade.wap.pay-JAVA-UTF-8/return_url.jsp";
    public static String return_url = "http://localhost:9095/flower/return_url";
    //public static String return_url = "http://localhost:9090/flower/detail/getdetail";

    // RSA2  签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "UTF-8";

    // 请求网关地址,支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 返回格式
    public static String FORMAT = "json";

    // 日志记录目录
    public static String log_path = "/log";




    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

